#pragma once

class GeneticAlgorithm
{
	private:
		double mutationRate;
        double crossoverRate;
        int popSize;
        int generationSize;
        int genomeSize;
        bool useElitism;
		double totalFitness;
		double fitAvg;
		double fitStdDev;
		
		STRATEGIES_ID _systToOptim;
		int _btBegin;
		int _btEnd;

		//Translator *_systCfgBuilder;

		vector<Genome*> nextGeneration;
		multimap<double, Genome*> fitnessTable;
		vector<double> _rsFitVals;
		vector<Genome*> _rsGens;

		void RankPopulation();
		void CreateNextGeneration(int t);
		Genome* RouletteSelection();
		double FitnessFunction(Genome *g);

	public:
		GeneticAlgorithm(double crossRate, double mutRate, int popSize, int genSize, int genomeSize, bool elitism);
		~GeneticAlgorithm(void);

		//void AddVarToOptmizae();
		void Evolve();
};